-----------------------------------------------------------------------------
--
-- Module      :  LLVM.Code.Instructions.Unified
-- Copyright   :  Mikhail Belyaev
-- License     :  GPL (Just (Version {versionBranch = [3], versionTags = []}))
--
-- Maintainer  :
-- Stability   :
-- Portability :
--
-- |
--
-----------------------------------------------------------------------------

module LLVM.Code.Instructions.Unified where
import LLVM.Code.Shared (CastOpcode, BinOpcode, ValIndex(..))


data UInstruction = UInstructionKind [ValIndex]
data UInstructionKind =
                   UBinary BinOpcode |
                   UCast CastOpcode|
                   UGEP |
                   USelect |
                   UExtractEl |
                   UInsertEl |
                   UShuffleVec |
                   UCmp |
                   URet |
                   UBranch |
                   USwitch |
                   UInvoke |
                   UUnwind |
                   UUnreachable |
                   UPhi |
                   UMalloc |
                   UFree |
                   UAlloca  |
                   ULoad  |
                   UCall  |
                   UStore  |
                   UExtractV  |
                   UInsertV  |
                   UIndirBr  deriving (Show,Eq)

class UnifiedInstruction a where
    unify :: a -> UInstruction
    deunify :: UInstruction -> a



